package com.liuyz;

public class String_ {

    public static void main(String[] args) {
        m3();
    }

    static void m1() {
        String a = "test1";
        String b = new String("test1");
        // System.out.println(a == b); // f
        System.out.println(a == b.intern()); // t

        b = "test2";
    }

    static void m2() {
        String formatStr = "姓名是%s，年龄是%d，成绩是%.2f，性别是%c。";
        String info = String.format(formatStr, "张三", 24, 26.3332, '男');
        System.out.println(info);
    }

    static void m3() {
        String a = "abc" + "def";
        String b = new String("zzz") + new String("xxx");
    }

}
